﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OsobaRadnoMjesto typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OsobaRadnoMjestoDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OsobaRadnoMjestoDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OsobaRadnoMjesto _currentOsobaRadnoMjesto = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOsobaRadnoMjestoDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOsobaRadnoMjestoErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOsobaRadnoMjestoBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOsoba property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOsobaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDRadnoMjesto property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDRadnoMjestoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumOd property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumOdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DatumDo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDatumDoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the PotrebnoUtvrdivanjeRadneSposobnosti property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Osoba> _IDOsobaList;
		
		/// <summary> 
		/// The list of selectable Osoba
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Osoba> IDOsobaList
		{
			get {return this._IDOsobaList;}
			set 
			{
				this._IDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DataSource = null;
				this.uxIDOsobaDataGridViewColumn.DataSource = this._IDOsobaList;
			}
		}
		
		private bool _allowNewItemInIDOsobaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Osoba
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOsobaList
		{
			get { return _allowNewItemInIDOsobaList;}
			set
			{
				this._allowNewItemInIDOsobaList = value;
				this.uxIDOsobaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.RadnoMjesto> _IDRadnoMjestoList;
		
		/// <summary> 
		/// The list of selectable RadnoMjesto
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.RadnoMjesto> IDRadnoMjestoList
		{
			get {return this._IDRadnoMjestoList;}
			set 
			{
				this._IDRadnoMjestoList = value;
				this.uxIDRadnoMjestoDataGridViewColumn.DataSource = null;
				this.uxIDRadnoMjestoDataGridViewColumn.DataSource = this._IDRadnoMjestoList;
			}
		}
		
		private bool _allowNewItemInIDRadnoMjestoList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of RadnoMjesto
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDRadnoMjestoList
		{
			get { return _allowNewItemInIDRadnoMjestoList;}
			set
			{
				this._allowNewItemInIDRadnoMjestoList = value;
				this.uxIDRadnoMjestoDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OsobaRadnoMjesto> _OsobaRadnoMjestoList;
				
		/// <summary> 
		/// The list of OsobaRadnoMjesto to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OsobaRadnoMjesto> OsobaRadnoMjestoList
		{
			get {return this._OsobaRadnoMjestoList;}
			set
			{
				this._OsobaRadnoMjestoList = value;
				this.uxOsobaRadnoMjestoBindingSource.DataSource = null;
				this.uxOsobaRadnoMjestoBindingSource.DataSource = value;
				this.uxOsobaRadnoMjestoDataGridView.DataSource = null;
				this.uxOsobaRadnoMjestoDataGridView.DataSource = this.uxOsobaRadnoMjestoBindingSource;				
				//this.uxOsobaRadnoMjestoBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOsobaRadnoMjestoBindingSource_ListChanged);
				this.uxOsobaRadnoMjestoBindingSource.CurrentItemChanged += new System.EventHandler(OnOsobaRadnoMjestoBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOsobaRadnoMjestoBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOsobaRadnoMjesto = uxOsobaRadnoMjestoBindingSource.Current as Entities.OsobaRadnoMjesto;
			
			if (_currentOsobaRadnoMjesto != null)
			{
				_currentOsobaRadnoMjesto.Validate();
			}
			//_OsobaRadnoMjesto.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOsobaRadnoMjestoBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OsobaRadnoMjesto"/> instance.
		/// </summary>
		public Entities.OsobaRadnoMjesto SelectedOsobaRadnoMjesto
		{
			get {return this._currentOsobaRadnoMjesto;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOsobaRadnoMjestoDataGridView.VirtualMode;}
			set
			{
				this.uxOsobaRadnoMjestoDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOsobaRadnoMjestoDataGridView.AllowUserToAddRows;}
			set {this.uxOsobaRadnoMjestoDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOsobaRadnoMjestoDataGridView.AllowUserToDeleteRows;}
			set {this.uxOsobaRadnoMjestoDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOsobaRadnoMjestoDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOsobaRadnoMjestoDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OsobaRadnoMjestoDataGridViewBase"/> class.
		/// </summary>
		public OsobaRadnoMjestoDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOsobaRadnoMjestoDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOsobaRadnoMjestoBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOsobaRadnoMjestoErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDOsobaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxIDRadnoMjestoDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDatumOdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDatumDoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDOsobaBindingSource = new OsobaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).BeginInit();
			//this.uxIDRadnoMjestoBindingSource = new RadnoMjestoBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDRadnoMjestoBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadnoMjestoDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadnoMjestoBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadnoMjestoErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOsobaRadnoMjestoErrorProvider
			// 
			this.uxOsobaRadnoMjestoErrorProvider.ContainerControl = this;
			this.uxOsobaRadnoMjestoErrorProvider.DataSource = this.uxOsobaRadnoMjestoBindingSource;						
			// 
			// uxOsobaRadnoMjestoDataGridView
			// 
			this.uxOsobaRadnoMjestoDataGridView.AutoGenerateColumns = false;
			this.uxOsobaRadnoMjestoDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOsobaRadnoMjestoDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDOsobaDataGridViewColumn,
		this.uxIDRadnoMjestoDataGridViewColumn,
		this.uxDatumOdDataGridViewColumn,
		this.uxDatumDoDataGridViewColumn,
		this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn			});
			this.uxOsobaRadnoMjestoDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOsobaRadnoMjestoDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOsobaRadnoMjestoDataGridView.Name = "uxOsobaRadnoMjestoDataGridView";
			this.uxOsobaRadnoMjestoDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOsobaRadnoMjestoDataGridView.TabIndex = 0;	
			this.uxOsobaRadnoMjestoDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOsobaRadnoMjestoDataGridView.EnableHeadersVisualStyles = false;
			this.uxOsobaRadnoMjestoDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOsobaRadnoMjestoDataGridViewDataError);
			this.uxOsobaRadnoMjestoDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaRadnoMjestoDataGridViewCellValueNeeded);
			this.uxOsobaRadnoMjestoDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOsobaRadnoMjestoDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDOsobaDataGridViewColumn
			//
			this.uxIDOsobaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOsobaDataGridViewColumn.DataPropertyName = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.HeaderText = "IDOsoba";
			this.uxIDOsobaDataGridViewColumn.Name = "uxIDOsobaDataGridViewColumn";
			this.uxIDOsobaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOsobaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOsobaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDRadnoMjestoDataGridViewColumn
			//
			this.uxIDRadnoMjestoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDRadnoMjestoDataGridViewColumn.DataPropertyName = "IDRadnoMjesto";
			this.uxIDRadnoMjestoDataGridViewColumn.HeaderText = "IDRadnoMjesto";
			this.uxIDRadnoMjestoDataGridViewColumn.Name = "uxIDRadnoMjestoDataGridViewColumn";
			this.uxIDRadnoMjestoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDRadnoMjestoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDRadnoMjestoDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumOdDataGridViewColumn
			//
			this.uxDatumOdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumOdDataGridViewColumn.DataPropertyName = "DatumOd";
			this.uxDatumOdDataGridViewColumn.HeaderText = "DatumOd";
			this.uxDatumOdDataGridViewColumn.Name = "uxDatumOdDataGridViewColumn";
			this.uxDatumOdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumOdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumOdDataGridViewColumn.ReadOnly = false;		
			//
			// uxDatumDoDataGridViewColumn
			//
			this.uxDatumDoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDatumDoDataGridViewColumn.DataPropertyName = "DatumDo";
			this.uxDatumDoDataGridViewColumn.HeaderText = "DatumDo";
			this.uxDatumDoDataGridViewColumn.Name = "uxDatumDoDataGridViewColumn";
			this.uxDatumDoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDatumDoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDatumDoDataGridViewColumn.ReadOnly = false;		
			//
			// uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn
			//
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.DataPropertyName = "PotrebnoUtvrdivanjeRadneSposobnosti";
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.HeaderText = "PotrebnoUtvrdivanjeRadneSposobnosti";
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.Name = "uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn";
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDOsobaDataGridViewColumn
			//				
			this.uxIDOsobaDataGridViewColumn.DisplayMember = "Ime";	
			this.uxIDOsobaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOsobaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOsobaDataGridViewColumn.DataSource = uxIDOsobaBindingSource;				
				
			//
			// uxIDRadnoMjestoDataGridViewColumn
			//				
			this.uxIDRadnoMjestoDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDRadnoMjestoDataGridViewColumn.ValueMember = "ID";	
			this.uxIDRadnoMjestoDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDRadnoMjestoDataGridViewColumn.DataSource = uxIDRadnoMjestoBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOsobaRadnoMjestoDataGridView);
			this.Name = "OsobaRadnoMjestoDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOsobaBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDRadnoMjestoBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadnoMjestoErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadnoMjestoDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOsobaRadnoMjestoBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OsobaRadnoMjestoDataGridViewEventArgs args = new OsobaRadnoMjestoDataGridViewEventArgs();
				args.OsobaRadnoMjesto = _currentOsobaRadnoMjesto;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OsobaRadnoMjestoDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OsobaRadnoMjesto	_OsobaRadnoMjesto;
	
			/// <summary>
			/// the  Entities.OsobaRadnoMjesto instance.
			/// </summary>
			public Entities.OsobaRadnoMjesto OsobaRadnoMjesto
			{
				get { return _OsobaRadnoMjesto; }
				set { _OsobaRadnoMjesto = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOsobaRadnoMjestoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaRadnoMjestoDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOsobaRadnoMjestoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaRadnoMjestoDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaRadnoMjestoDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OsobaRadnoMjestoList[e.RowIndex].ID;
						break;
					case "uxIDOsobaDataGridViewColumn":
						e.Value = OsobaRadnoMjestoList[e.RowIndex].IDOsoba;
						break;
					case "uxIDRadnoMjestoDataGridViewColumn":
						e.Value = OsobaRadnoMjestoList[e.RowIndex].IDRadnoMjesto;
						break;
					case "uxDatumOdDataGridViewColumn":
						e.Value = OsobaRadnoMjestoList[e.RowIndex].DatumOd;
						break;
					case "uxDatumDoDataGridViewColumn":
						e.Value = OsobaRadnoMjestoList[e.RowIndex].DatumDo;
						break;
					case "uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn":
						e.Value = OsobaRadnoMjestoList[e.RowIndex].PotrebnoUtvrdivanjeRadneSposobnosti;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOsobaRadnoMjestoDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOsobaRadnoMjestoDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOsobaRadnoMjestoDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OsobaRadnoMjestoList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDOsobaDataGridViewColumn":
						OsobaRadnoMjestoList[e.RowIndex].IDOsoba = (System.Int32)e.Value;
						break;
					case "uxIDRadnoMjestoDataGridViewColumn":
						OsobaRadnoMjestoList[e.RowIndex].IDRadnoMjesto = (System.Int32)e.Value;
						break;
					case "uxDatumOdDataGridViewColumn":
						OsobaRadnoMjestoList[e.RowIndex].DatumOd = (System.DateTime)e.Value;
						break;
					case "uxDatumDoDataGridViewColumn":
						OsobaRadnoMjestoList[e.RowIndex].DatumDo = (System.DateTime?)e.Value;
						break;
					case "uxPotrebnoUtvrdivanjeRadneSposobnostiDataGridViewColumn":
						OsobaRadnoMjestoList[e.RowIndex].PotrebnoUtvrdivanjeRadneSposobnosti = (System.Int32?)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
